package dao

import (
	"gorm.io/driver/sqlite"
	"gorm.io/gorm"
	"gorm.io/gorm/logger"
	"log"
)

var DB *gorm.DB

func init() {
	db, err := gorm.Open(sqlite.Open(`G:\go_projects\view-crawler-backend\sqlite\task.db`), &gorm.Config{
		Logger:                 logger.Default.LogMode(logger.Info),
		SkipDefaultTransaction: true,
		CreateBatchSize:        100,
	})
	if err != nil {
		log.Fatal("连接SQLite数据库失败")
	}
	DB = db
}
